package uz.gov.test;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import uz.gov.pages.*;



/**
 * Created by IIGalytska on 04.04.14.
 */
public class RezetkaOrderTestPositive extends PrePostConditions{
    @DataProvider(name = "test2")
    public Object[][] provideData() {

        return new Object[][] {
                { "angelina goli", "0979999999","angelina_goli41@ukr.net" },
                /**
                { 2 , "http://rozetka.com.ua/phones-mp3-gps/c80257/"},
                { 3 , "http://rozetka.com.ua/tv-photo-video/c80258/"},
                **/

        };
    }



    @Test(dataProvider = "test2")

    public void testOrder(String param1, String param2, String param3){

        //start from home page
        HomePage home = new HomePage(driver);
        //navigate to product search result page
        ResultPage result = home.search("ipad");
        //press bey! button for the first link
        CartWindow cart = result.pressBuyForFirstLink();
        //press checkout button

        CheckoutPage checkout  = cart.pressCheckoutButton();

        ConfirmationPage confirm= checkout.fillInDataPositive(param1, param2, param3);

        Assert.assertTrue(confirm.checkConfirmOrderButton());

    }

























}
